package com.bnzjy.srb.core.service;

import com.bnzjy.srb.core.pojo.entity.BorrowInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bnzjy.srb.core.pojo.vo.BorrowInfoApprovalVO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 借款信息表 服务类
 * </p>
 *
 * @author Helen
 * @since 2021-12-13
 */
public interface BorrowInfoService extends IService<BorrowInfo> {
    
    /**
     * 给借款人获取借款额度
     * @param userId
     * @return
     */
    BigDecimal getBorrowAmount(Long userId);
    
    /**
     * 借款人提交借款额度的申请
     * @param borrowInfo
     * @param userId
     */
    void saveBorrowInfo(BorrowInfo borrowInfo, Long userId);
    
    /**
     * 借款人信息列表
     * @return
     */
    List<BorrowInfo> selectList();
    
    /**
     * 借款详情
     * @param id
     * @return
     */
    Map<String, Object> getBorrowInfoDetail(Long id);
    
    /**
     * 管理人员进行借款审批
     * @param borrowInfoApprovalVO
     */
    void approval(BorrowInfoApprovalVO borrowInfoApprovalVO);
    
    /**
     * 获取借款状态
     * @param userId
     * @return
     */
    Integer getStatusByUserId(Long userId);
}
